import { createSlice } from '@reduxjs/toolkit';
import { UserSlice } from '../interface/user';

export const initialState: UserSlice.UserState = { name: 'lx', token: '' };

export const userSlice = createSlice({
  name: 'user',
  initialState,
  reducers: {
    setName(state, action) {
      state.name = action.payload;
    },
  },
});

export const { setName } = userSlice.actions;
